home *** CD-ROM | disk | FTP | other *** search
/ The Original Shareware 1.1 / The Original Shareware (WeMake CDs)(Volume 1.1)(CDs, Inc)(1993).iso / 6 / hanson.zip / ESCT.C < prev    next >
Text File  |  1985-12-31  |  512b  |  22 lines

  1. /* version.c by Michael Hanson */
  2. /* you may use this, but not for profit, and give me credit */ 
  3. /* esc - map string into escaped character if appropriate */
  4.  
  5. char esc(s,i)
  6. register char s[];
  7. int *i;
  8. {
  9.     int index();
  10.     static char real[] = " \\\b\t\v\f\n\r\(\!\)\^";
  11.     static char symb[] = "s\\btvfnr(!)^";
  12.  
  13.     if(s[*i] != '\\')
  14.         return s[*i];
  15.     if(s[*i] == '\0')  /* not special at end */
  16.         return '\\';
  17.     (*i)++;
  18.     real[sizeof(real)-1] = s[*i];
  19.     return real[index(symb, s[*i])];
  20. }
  21.  
  22.